const categoryHttp = require("../../utils/category")
const ManHttp = require("../../utils/man")
Page({
  data: {
    list:{}
  },
  async onLoad() {
    try {
      var man = await ManHttp.getMan();
      // console.log(man)
      var woman = await categoryHttp.getWoman();
      var spring = await categoryHttp.getSpring();
      var summer = await categoryHttp.getSummer();
      var autumn = await categoryHttp.getAutumn();
      var winter = await categoryHttp.getWinter();
      this.setData({
        list: {
          man: {
            id:1,
            title: "男装会场",
            res: man.data
          },
          woman: {
            id:2,
            title: "女装会场",
            res: woman.data
          },
          spring: {
            id:3,
            title: "春装",
            res: spring.data
          },
          summer: {
            id:4,
            title: "夏装",
            res: summer.data
          },
          autumn: {
            id:5,
            title: "秋装",
            res: autumn.data
          },
          winter: {
            id:6,
            title: "冬装",
            res: winter.data
          }
        }
      })
    } catch (err) {
      console.log(err)
    }
  },
  handleList(event) {
    // console.log(event.currentTarget.dataset);
    var { aid } = event.currentTarget.dataset;
    console.log(aid)
    wx.navigateTo({
      url: `/pages/goods_list/index?id=${aid}`,
    });
  }
})